/*
 * FileReader.h
 *
 *  Created on: Jan 23, 2012
 *      Author: Ivan
 */

#ifndef FILEREADER_H_
#define FILEREADER_H_


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <assert.h>
#include "DecodedStructs.h"
#include "disassembler.h"
#include "format.h"

 /*Output Instruction structure */







	/* allocate a new instruction list */
	ILIST *NewInstructionList();

	/* delete a instruction list (and all entries) */
	void DeleteInstructionList(ILIST *l);

	/* insert an instruction into a list */
	void AppendInstruction(ILIST *l, unsigned int y);


	/*working Bin File Reader*/
	ILIST * ReadBinFileIvanStyleInt (char * fname);

	/*creates the proper int from the improper big endian*/
	unsigned int switchorder(unsigned int x);

	/*this function takes the user inputted .elf file, then converts it to a binary file*/
	void convertelf(char *filename);


	/*this function takes the user inputted .hex file, then converts it to a binary file*/
	void convertHex(char *filename);

	/*Temporary Test Instruction*/
	void Test_Instruction(ILIST *h);




	/*Output team*/
	void FileWrite(ILIST * l,char * fname);



#endif /* FILEREADER_H_ */
